import { $get, $post } from '@js/request'
import { DocumentTemplateSchema } from '@src/components/schema/document'

export async function getTemplateListRequest (): Promise<{ list: DocumentTemplateSchema[], total: number }> {
  const condition = [
    { k: 'temp_sign_type', o: 'not null' }
  ]
  const res = await $get('/api/commission/file_template', {
    condition: JSON.stringify(condition),
    limit: 100000,
  })
  return res.data
}

export async function addRequest (d: { [k: string]: any }) {
  const res = await $post('/api/commission/document/createByKey', d)
  return res.data
}